package com.diabeco.model.measures;

import java.util.Date;

import android.text.format.DateFormat;

public class GlycemiaMeasure {
	private Long id;
	private Long date;
	private Float value;
	private GlycemiaUnit unit;

	public GlycemiaMeasure() {
		this.setDate(new Date().getTime());
		this.setValue(0.0F);
		this.setUnit(GlycemiaUnit.MGDL);
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getDate() {
		return date;
	}

	public void setDate(Long date) {
		this.date = date;
	}

	public Float getValue() {
		return value;
	}

	public void setValue(Float value) {
		this.value = value;
	}

	public GlycemiaUnit getUnit() {
		return unit;
	}

	public void setUnit(GlycemiaUnit unit) {
		this.unit = unit;
	}

	public String toString() {
		return DateFormat.format("dd/MMM hh:mm", this.getDate()) + ": " + this.getValue() + " (" + this.getUnit().getName() + ")";
	}
}
